Skip to content

feat: add pwa app and dashboard interaction updates#735

Closed
BigSimmo wants to merge 6 commits into
mainfrom
codex/pwa-optimization-pr-ready
Closed

feat: add pwa app and dashboard interaction updates#735
BigSimmo wants to merge 6 commits into
mainfrom
codex/pwa-optimization-pr-ready

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reintroduce route-based navigation for Applications, Presentations, and Medications after route deprecation changes.
  • Add PWA-oriented dashboard and lifecycle improvements for scoped refresh handling and ingestion/work-state caching.
  • Add RAG scalability patch migrations and supporting tests for retrieval hardening.
  • Regenerate site map index route docs and related checks.

Notes

  • Merge involved manual conflict resolution after concurrent schema/retrieval changes on main.
  • Verified PR still compiles after resolving duplicate imports and route resolver issues.

Verification

  • npm run check:runtime (pass)
  • npm run test:e2e:pr --project=chromium --grep-invert "@quarantine|@mockup" (pass)
    • Includes required test:e2e:pr browser coverage path for Chromium with quarantine/mockup filter.
    • Pass criteria: command returned exit code 0 and produced a successful verify:ui run after fixups.

Clinical Governance Preflight

  • Not applicable: no clinical document generation, retrieval policy, or source governance model changes were introduced.
  • No migration of clinical source contracts; this patch only adjusts API route resolution and PWA/dashboard runtime behavior.

Risk and rollout

  • Risk: Build and type errors from API route module resolution could block merge and deployment.
    • Mitigation: fixed duplicate import in src/app/layout.tsx and normalized @/lib-to-relative imports in affected API routes; verified by successful runtime build/test command.
  • Rollout: merge through required PR checks after branch update; no data model changes required.

@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy due to reaching the limit of concurrent preview branches.
Go to Project Integrations Settings ↗︎ if you wish to update this limit.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Copilot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 15 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c94f898a-fb7b-4d89-a247-8ca26b0d2cd0

📥 Commits

Reviewing files that changed from the base of the PR and between f9f2e59 and b57c921.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (55)
  • .github/workflows/ci.yml
  • .github/workflows/pr-policy.yml
  • docs/branch-review-ledger.md
  • docs/site-map.md
  • docs/tenancy-defense-in-depth-review.md
  • package.json
  • scripts/check-owner-scope-api.mjs
  • src/app/api/documents/[id]/labels/route.ts
  • src/app/api/documents/[id]/table-facts/route.ts
  • src/app/api/documents/bulk/route.ts
  • src/app/globals.css
  • src/app/therapy-compass/page.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/DocumentViewer.tsx
  • src/components/clinical-dashboard/ClinicalSidebar.tsx
  • src/components/clinical-dashboard/dashboard-shell.tsx
  • src/components/clinical-dashboard/differentials-home.tsx
  • src/components/clinical-dashboard/document-results.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/clinical-dashboard/favourites-hub.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/clinical-dashboard/medication-prescribing-workspace.tsx
  • src/components/clinical-dashboard/patient-profile-panel.tsx
  • src/components/clinical-dashboard/search-results-header-band.tsx
  • src/components/clinical-dashboard/settings-dialog.tsx
  • src/components/clinical-dashboard/universal-search-also-matches.tsx
  • src/components/forms/form-code-badge.tsx
  • src/components/forms/form-detail-page.tsx
  • src/components/forms/forms-search-results-page.tsx
  • src/components/formulation/formulation-builder-page.tsx
  • src/components/formulation/formulation-home-page.tsx
  • src/components/services/service-detail-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/components/therapy-compass/bindings.tsx
  • src/components/therapy-compass/controls.ts
  • src/components/therapy-compass/nav.tsx
  • src/components/therapy-compass/screens/brief-screen.tsx
  • src/components/therapy-compass/screens/compare-screen.tsx
  • src/components/therapy-compass/screens/detail-screen.tsx
  • src/components/therapy-compass/screens/other-screen.tsx
  • src/components/therapy-compass/screens/pathways-screen.tsx
  • src/components/therapy-compass/screens/recommend-screen.tsx
  • src/components/therapy-compass/screens/sheets-screen.tsx
  • src/components/therapy-compass/styles.tsx
  • src/components/therapy-compass/therapy-card.tsx
  • src/components/ui/sheet.tsx
  • src/lib/api-rate-limit.ts
  • src/lib/app-modes.ts
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • supabase/migrations/20260717139000_create_storage_buckets.sql
  • tests/document-admin-rate-limit.test.ts
  • tests/document-mutation-routes.test.ts
  • tests/owner-scope-guard.test.ts
📝 Walkthrough

Walkthrough

The PR updates route redirects and sitemap generation, refactors RAG retrieval and caching, adds Supabase cleanup and query-correction schema changes, revises form and service interfaces, and expands accessibility, mobile, regression, and tooling coverage.

Changes

Routing and retrieval

Layer / File(s) Summary
Route discovery and redirects
scripts/generate-site-map.ts, src/app/.../route.ts, src/lib/legacy-home-redirect.ts, docs/site-map.md, tests/site-map.test.ts
Route handlers are classified into API and public groups, redirect targets are documented, and legacy redirects preserve selected query parameters.
RAG retrieval and hydration caching
src/lib/rag.ts, src/lib/rag-candidate-sources.ts, tests/rag-chunk-load-cache.test.ts, tests/retrieval-hydration-scope.test.ts
Abort-signal plumbing is removed from retrieval calls, scoped chunk hydration caching is added, and visual-evidence and ranking flows are rewired.
Supabase cleanup and query correction
supabase/migrations/*, supabase/schema.sql, supabase/drift-manifest.json, tests/supabase-schema.test.ts
Registry cleanup triggers, title-word vocabulary maintenance, trigram indexes, bounded query correction, and privilege updates are added and validated.

Forms, services, and UI

Layer / File(s) Summary
Form provenance and metadata
src/app/forms/[slug]/page.tsx, src/app/services/[slug]/page.tsx, src/components/forms/form-detail-page.tsx, tests/audit-content-services-regressions.test.ts
Metadata becomes record-driven, provenance displays distinguish verification from local confirmation, and source-review information is conditionally rendered.
Service comparison controls
src/lib/service-navigator-metrics.ts, src/components/services/services-navigator-page.tsx
Service metrics, expandable checklist and confidence sections, comparison gating, and selected-service comparison details are implemented.
Accessibility, mobile, and tooling
src/components/..., tests/ui-*.spec.ts, tests/mobile-interaction-regressions.test.ts, package.json, scripts/*
Focus dismissal, tap-target sizing, mobile overflow behavior, test timing, script permissions, workflow discovery, and migration execution are updated.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

Suggested labels: dependencies, javascript

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.51% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and relevant, but it only covers part of the changes and omits route restoration and RAG/documentation updates.
Description check ✅ Passed The description covers the main changes and required sections, but the verification checklist does not fully match the repository template.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pwa-optimization-pr-ready

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

CI triage

CI failed on this PR. Automated classification of the 7 failed job(s):

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Advisory UIneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Buildneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Production UIneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Unit coverageneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • Safety and config checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #2833 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo force-pushed the codex/pwa-optimization-pr-ready branch from 659472a to df55f5c Compare July 17, 2026 18:12
@BigSimmo
BigSimmo force-pushed the codex/pwa-optimization-pr-ready branch from df55f5c to eb5bc2d Compare July 17, 2026 18:22
@BigSimmo
BigSimmo enabled auto-merge July 17, 2026 18:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/forms/form-detail-page.tsx (1)

33-34: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Restore the declarations removed by this refactor.

Removing codeText leaves its Line 231 reference unresolved, while sourceItems and verificationItems are also used without declarations. Type checking will fail until the import and derived arrays are restored or their usages are removed.

Also applies to: 239-273

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/forms/form-detail-page.tsx` around lines 33 - 34, Restore the
codeText import and the sourceItems and verificationItems declarations in the
form-detail component, ensuring they provide the existing usages around lines
231 and 239-273 with the expected derived data. Alternatively, remove those
usages only if the refactor no longer requires them, while keeping the component
type-checking successfully.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/generate-site-map.ts`:
- Around line 394-405: Update the route collection used by the “Main product
routes” section so product route handlers from publicRouteHandlers are included
alongside productRoutes before generating lines. Preserve their exclusion from
“Public utility route handlers,” and ensure routes such as /applications,
/differentials/presentations, and /medications appear in the main product
section.

In `@src/app/differentials/presentations/route.ts`:
- Around line 5-10: Update the query selection in GET so a missing or
blank-after-trimming query parameter falls back to q. Trim each candidate before
choosing it, while preserving the existing selectedIds parsing behavior.

In `@src/components/forms/form-detail-page.tsx`:
- Line 589: Update the label for the action opening form.source.url in the form
detail component so the visible text and accessible name accurately describe
opening the official source, replacing the misleading “Related forms” wording
while preserving the existing link behavior.

In `@src/lib/rag.ts`:
- Around line 1362-1369: Update the request-scoped RAG flows around the shown
classifier verdict await to preserve args.signal at I/O boundaries: pass the
request signal into local Supabase queries/RPCs, including alias, correction,
and retrieval operations, so cancellation stops those awaits promptly. Keep
shared classifier work independent when intentionally reused, while ensuring
aborted requests still propagate cancellation rather than being swallowed by
fallback handling.

In `@supabase/drift-manifest.json`:
- Around line 2-6: Revert the changes to the generated drift-manifest artifact,
or regenerate it using a healthy Docker-backed replay before merging. Ensure the
resulting manifest is not marked freshly generated unless its timestamp and
schema_sha256 reflect that replay, and verify it includes
documents_sync_title_words.

In `@supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql`:
- Around line 2-11: Align the document_table_facts_text_trgm_idx migration with
the trgm_matches RPC predicate by indexing only table_title, row_label, and
clinical_parameter. Remove threshold_value and action from the expression, or
remove this redundant migration if the existing narrow index already provides
the correct expression; do not retain both indexes.

In `@tests/audit-content-services-regressions.test.ts`:
- Around line 208-215: Align the source-link class assertion in the test with
the class used by the anchor in FormDetailPage. Update the min-h-tap expectation
to match the component’s existing min-h-10 class unless the component is
intentionally being changed to use the larger tap target.

---

Outside diff comments:
In `@src/components/forms/form-detail-page.tsx`:
- Around line 33-34: Restore the codeText import and the sourceItems and
verificationItems declarations in the form-detail component, ensuring they
provide the existing usages around lines 231 and 239-273 with the expected
derived data. Alternatively, remove those usages only if the refactor no longer
requires them, while keeping the component type-checking successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: af0a49bd-f391-482f-905d-a53a729e36d8

📥 Commits

Reviewing files that changed from the base of the PR and between a6ac8c0 and f9f2e59.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (51)
  • .npmrc
  • docs/codebase-index.md
  • docs/rag-scalability-wip-review-handover-2026-07-15.md
  • docs/site-map.md
  • package.json
  • playwright.config.ts
  • scripts/check-codebase-index-coverage.mjs
  • scripts/check-github-action-pins.mjs
  • scripts/check-m13-migration.ts
  • scripts/generate-site-map.ts
  • src/app/applications/page.tsx
  • src/app/applications/route.ts
  • src/app/differentials/presentations/page.tsx
  • src/app/differentials/presentations/route.ts
  • src/app/forms/[slug]/page.tsx
  • src/app/layout.tsx
  • src/app/medications/page.tsx
  • src/app/medications/route.ts
  • src/app/page.tsx
  • src/app/services/[slug]/page.tsx
  • src/components/clinical-dashboard/answer-status.tsx
  • src/components/clinical-dashboard/favourites-command-library-page.tsx
  • src/components/clinical-dashboard/master-search-header.tsx
  • src/components/differentials/differential-presentation-workflow-page.tsx
  • src/components/differentials/differential-stream-page.tsx
  • src/components/forms/form-detail-page.tsx
  • src/components/forms/forms-home-page.tsx
  • src/components/privacy-input-notice.tsx
  • src/components/services/service-detail-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/lib/legacy-home-redirect.ts
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • src/lib/service-navigator-metrics.ts
  • supabase/drift-manifest.json
  • supabase/migrations/20260714180000_patch_rag_and_corrector_scalability.sql
  • supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql
  • supabase/migrations/20260717010000_harden_rag_scalability_patch.sql
  • supabase/schema.sql
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/codebase-index-coverage.test.ts
  • tests/mobile-interaction-regressions.test.ts
  • tests/rag-chunk-load-cache.test.ts
  • tests/registry-corpus.test.ts
  • tests/retrieval-hydration-scope.test.ts
  • tests/site-map.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-accessibility.spec.ts
  • tests/ui-smoke.spec.ts
  • tests/ui-tools.spec.ts
💤 Files with no reviewable changes (4)
  • src/app/differentials/presentations/page.tsx
  • src/app/medications/page.tsx
  • src/app/applications/page.tsx
  • src/app/page.tsx

Comment on lines +394 to 405
const publicUtilityRouteHandlers = data.publicRouteHandlers.filter(
(route) => !productRouteHandlerPaths.has(route.route),
);

const lines = [
"# Clinical KB Site Map",
"",
"This file is generated by `npm run sitemap:update`. Run `npm run sitemap:check` to verify it is current.",
"",
...section(
"Main product pages",
"Main product routes",
productRoutes.map((route) => routeLine(route, routeDescriptions)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Include product route handlers in the main product section.

These handlers are filtered out of “Public utility route handlers” but never added to productRoutes. Consequently, /applications, /differentials/presentations, and /medications are absent from “Main product routes,” failing the assertion at tests/site-map.test.ts Lines 88-94.

Proposed fix
-  const productRoutes = data.pageRoutes.filter(
+  const productRoutes = [
+    ...data.pageRoutes.filter(
       (route) =>
         !route.route.startsWith("/api") &&
         !route.route.startsWith("/mockups") &&
         ![
           // ...
         ].includes(route.route),
-  );
+    ),
+    ...data.publicRouteHandlers.filter((route) => productRouteHandlerPaths.has(route.route)),
+  ].sort((left, right) => left.route.localeCompare(right.route));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/generate-site-map.ts` around lines 394 - 405, Update the route
collection used by the “Main product routes” section so product route handlers
from publicRouteHandlers are included alongside productRoutes before generating
lines. Preserve their exclusion from “Public utility route handlers,” and ensure
routes such as /applications, /differentials/presentations, and /medications
appear in the main product section.

Comment on lines +5 to +10
export function GET(request: NextRequest) {
const query = (request.nextUrl.searchParams.get("query") ?? request.nextUrl.searchParams.get("q"))?.trim();
const selectedIds = (request.nextUrl.searchParams.get("ids") ?? "")
.split(",")
.map((id) => id.trim())
.filter(Boolean);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fall back to q when query is blank.

Nullish coalescing treats query="" or whitespace as present, so a valid q is discarded.

Proposed fix
-  const query = (request.nextUrl.searchParams.get("query") ?? request.nextUrl.searchParams.get("q"))?.trim();
+  const query =
+    request.nextUrl.searchParams.get("query")?.trim() ||
+    request.nextUrl.searchParams.get("q")?.trim();
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function GET(request: NextRequest) {
const query = (request.nextUrl.searchParams.get("query") ?? request.nextUrl.searchParams.get("q"))?.trim();
const selectedIds = (request.nextUrl.searchParams.get("ids") ?? "")
.split(",")
.map((id) => id.trim())
.filter(Boolean);
export function GET(request: NextRequest) {
const query =
request.nextUrl.searchParams.get("query")?.trim() ||
request.nextUrl.searchParams.get("q")?.trim();
const selectedIds = (request.nextUrl.searchParams.get("ids") ?? "")
.split(",")
.map((id) => id.trim())
.filter(Boolean);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/differentials/presentations/route.ts` around lines 5 - 10, Update the
query selection in GET so a missing or blank-after-trimming query parameter
falls back to q. Trim each candidate before choosing it, while preserving the
existing selectedIds parsing behavior.

>
<FileText className="h-4 w-4" aria-hidden />
<span>Source</span>
<span>Related forms</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Label this source-opening action accurately.

The button says “Related forms,” but it opens form.source.url and its accessible name says “Open official source.”

Proposed fix
-<span>Related forms</span>
+<span>Official source</span>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<span>Related forms</span>
<span>Official source</span>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/forms/form-detail-page.tsx` at line 589, Update the label for
the action opening form.source.url in the form detail component so the visible
text and accessible name accurately describe opening the official source,
replacing the misleading “Related forms” wording while preserving the existing
link behavior.

Comment thread src/lib/rag.ts
Comment on lines +2 to +6
"generated_at": "2026-07-17T14:08:59.595Z",
"generator": "scripts/generate-drift-manifest.ts",
"postgres_image": "supabase/postgres:17.6.1.127",
"schema_sha256": "bde3b7c60872a8c4493555e6670c30ac777a862a12567ef2091dfc050c86240e",
"replay_seconds": 77,
"schema_sha256": "e93fe90cae38654e77b7be0f81e5a0c90b0c7db2fd37d76e32f4f52a089eff45",
"replay_seconds": 30,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not mark the stale drift snapshot as freshly generated.

The PR objective says Docker-backed regeneration is still pending, yet Lines 2–6 publish a new timestamp/hash. The snapshot also omits documents_sync_title_words, so accepting it as authoritative can hide a deployment where title correction stops updating. Revert this artifact or regenerate it from a healthy replay before merge.

Also applies to: 6327-6334

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/drift-manifest.json` around lines 2 - 6, Revert the changes to the
generated drift-manifest artifact, or regenerate it using a healthy
Docker-backed replay before merging. Ensure the resulting manifest is not marked
freshly generated unless its timestamp and schema_sha256 reflect that replay,
and verify it includes documents_sync_title_words.

Comment on lines +2 to +11
create index if not exists document_table_facts_text_trgm_idx
on public.document_table_facts using gin (
lower(
coalesce(table_title, '') || ' ' ||
coalesce(row_label, '') || ' ' ||
coalesce(clinical_parameter, '') || ' ' ||
coalesce(threshold_value, '') || ' ' ||
coalesce(action, '')
) extensions.gin_trgm_ops
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Match the trigram index expression to the RPC predicate.

trgm_matches searches only title, row label, and clinical parameter, while this index additionally includes threshold and action. PostgreSQL therefore cannot use it for that predicate, and the existing narrow index already matches. Remove this migration, or update the RPC expression and replace the narrow index rather than retaining both.

🧰 Tools
🪛 Squawk (2.59.0)

[warning] 2-11: During normal index creation, table updates are blocked, but reads are still allowed. Use concurrently to avoid blocking writes.

(require-concurrent-index-creation)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@supabase/migrations/20260714190000_document_table_facts_trgm_idx.sql` around
lines 2 - 11, Align the document_table_facts_text_trgm_idx migration with the
trgm_matches RPC predicate by indexing only table_title, row_label, and
clinical_parameter. Remove threshold_value and action from the expression, or
remove this redundant migration if the existing narrow index already provides
the correct expression; do not retain both indexes.

Comment thread tests/audit-content-services-regressions.test.ts
@BigSimmo

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts on this branch.

- Resolve conflict in src/components/forms/form-detail-page.tsx:
  add FormCodeBadge integration and formCode helper from main, fix
  PathwayContextCard to use parallelForms/afterForms from main,
  add missing codeText import, add code prop to PathwayContextCard
- Resolve conflict in src/components/services/services-navigator-page.tsx:
  accept main's size-tap CSS while preserving aria-pressed/comparison labels
- Fix TypeScript errors from merge:
  add chunkLoadCache (createChunkLoadCache) to searchChunksWithTelemetry,
  import serviceNavigatorMetrics/canCompareServices in services-navigator-page,
  expand HomeProps searchParams type with q/focus/run fields,
  add signal parameter to callVersionedRetrievalRpc for abort propagation,
  add signal option to analyzeQueryWithClassifierFallback for per-caller cancellation
auto-merge was automatically disabled July 17, 2026 20:25

Head branch was pushed to by a user without write access

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Merge conflicts resolved in commit b57c9218.

Conflicts resolved:

  • src/components/forms/form-detail-page.tsx — integrated FormCodeBadge and formCode helper from main, fixed PathwayContextCard to use parallelForms/afterForms, added missing codeText import
  • src/components/services/services-navigator-page.tsx — accepted main's size-tap CSS while preserving aria-pressed and comparison aria labels required by branch tests

TypeScript errors fixed post-merge:

  • Added chunkLoadCache declaration (via createChunkLoadCache) in searchChunksWithTelemetry — unblocked 16 previously-failing RAG tests
  • Added serviceNavigatorMetrics/canCompareServices imports in services-navigator-page
  • Expanded HomeProps.searchParams type with q, focus, run fields
  • Added signal?: AbortSignal to callVersionedRetrievalRpc and analyzeQueryWithClassifierFallback for abort propagation support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants